import Vue from "vue"
import VueRouter from "vue-router"
//将VueRouter注入所有子组件

Vue.use(VueRouter)

//路由配置routes

let routes = [
  {
    path: "/discover",
    component: () => import("@/pages/discover"),
    children: [
      {
        path: "djradio",
        component: () => import("@/pages/discover/djradio")
      },
      {
        path: "playlist",
        component: () => import("@/pages/discover/playlist")
      }
    ]
  },
  {
    path: "/friend/:ll",
    component: () => import("@/pages/friend")
  },
  {
    path: "/mymusic",
    component: () => import("@/pages/mymusic")
  },
  {
    path: "/list",
    component: () => import("@/pages/list")
  },
  {
    path: "/detail/:productid",
    component: () => import("@/pages/detail")
  },
  {
    path: "*",
    component: () => import("@/pages/page404")
  }
]

//实例化vue路由

let router = new VueRouter({
  routes
})

export default router
